<?php
class LocalAccount extends AppModel {
  var $name = 'LocalAccount';
  var $validate = array(
    'user_id' => array('notEmpty'),
    'username' => array(
      'notempty' => array(
        'rule' => array('notEmpty'),
        'message' => 'Bitte gib deinen Nutzernamen an',
      ),
      'alphanumeric' => array(
        'rule' => array('alphaNumeric'),
        'message' => 'Der Nutzername darf nur aus Buchstaben und Ziffern bestehen',
      ),
      'unique' => array(
        'rule' => array('isUnique'),
        'message' => 'Der Nutzername muss eindeutig sein',
      ),
    ),
    'password' => array(
      'minlength' => array(
        'rule' => array('minLength', 6),
        'message' => 'Das Kennwort muss mindestens sechs Zeichen lang sein',
      ),
    ),
    'code' => array(
      'notempty' => array(
        'rule' => 'notEmpty',
        'message' => 'Der Code darf nicht leer sein',
      ),
      'unique' => array(
        'rule' => 'isUnique',
        'message' => 'Der Code muß eindeutig sein',
      ),
    ),
  );

  //The Associations below have been created with all possible keys, those that are not needed can be removed
  var $belongsTo = array(
    'User' => array(
      'className' => 'User',
      'foreignKey' => 'user_id',
      'conditions' => '',
      'fields' => '',
      'order' => ''
    )
  );
}
